package org.allen.mst4j.action;

import java.io.Serializable;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.allen.mst4j.domain.OriginalMachine;
import org.allen.mst4j.domain.SkillNature;
import org.allen.mst4j.sysBean.PagerBean;
import org.allen.mst4j.sysBean.ResultBean;
import org.allen.mst4j.service.OriginalMachineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@Scope("session")
@RequestMapping("/admin/originalMachine")
public class OriginalMachineAction implements Serializable{

	private static final long serialVersionUID = 1L;

	@Autowired
	protected OriginalMachineService service;
	
	@RequestMapping(method = RequestMethod.GET)
	@ResponseBody
	public PagerBean<OriginalMachine> selectByPage(
			HttpServletRequest request,HttpServletResponse response,OriginalMachine obj) {
		return service.selectByPage(obj);
	}
	
	@RequestMapping(method = RequestMethod.POST)
	@ResponseBody
	public ResultBean<OriginalMachine> insert(
			HttpServletRequest request,HttpServletResponse response,OriginalMachine obj) {
		return service.insert(obj);
	}
	
	@RequestMapping(method = RequestMethod.PUT)
	@ResponseBody
	public ResultBean<OriginalMachine> update(
			HttpServletRequest request,HttpServletResponse response,OriginalMachine obj) {
		return service.update(obj);
	}
	
	@RequestMapping(value="/skillNatureCombo",method = RequestMethod.GET)
	@ResponseBody
	public PagerBean<SkillNature> selectSkillNature() {
		return service.selectSkillNature();
	}
}
